package com.project.yuepai.dto;

import com.project.yuepai.model.User;
import com.project.yuepai.model.UserRole;

import java.time.LocalDateTime;

public class UserRoleDto{
    private String userId;
    private String userName;
    private int userRole;
    private String nickName;
    private String phone;
    private String loginPwd;
    private String email;
    private int age;
    private boolean sex;
    private LocalDateTime registerDate;
    private String userIconPath;
    private int roleId; //展示id
    private String content;//展示文本
    private String showPhoto;//展示图片
    private int orderStatus;//预约状态 0-可预约 1-已被预约
    private int completeWorks;//完成作品数

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getUserRole() {
        return userRole;
    }

    public void setUserRole(int userRole) {
        this.userRole = userRole;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getLoginPwd() {
        return loginPwd;
    }

    public void setLoginPwd(String loginPwd) {
        this.loginPwd = loginPwd;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public LocalDateTime getRegisterDate() {
        return registerDate;
    }

    public void setRegisterDate(LocalDateTime registerDate) {
        this.registerDate = registerDate;
    }

    public String getUserIconPath() {
        return userIconPath;
    }

    public void setUserIconPath(String userIconPath) {
        this.userIconPath = userIconPath;
    }

    public int getRoleId() {
        return roleId;
    }

    public void setRoleId(int roleId) {
        this.roleId = roleId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getShowPhoto() {
        return showPhoto;
    }

    public void setShowPhoto(String showPhoto) {
        this.showPhoto = showPhoto;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public int getCompleteWorks() {
        return completeWorks;
    }

    public void setCompleteWorks(int completeWorks) {
        this.completeWorks = completeWorks;
    }

    public void fill(User user,UserRole role){
        userId = user.getUserId();
        userName = user.getUserName();
        userRole = user.getUserRole();
        nickName = user.getNickName();
        phone = user.getPhone();
        loginPwd = user.getLoginPwd();
        email = user.getEmail();
        age = user.getAge();
        sex = user.isSex();
        registerDate = user.getRegisterDate();
        userIconPath = user.getUserIconPath();
        roleId = role.getRoleId();
        content = role.getContent();
        showPhoto = role.getShowPhoto();
        orderStatus = role.getOrderStatus();
        completeWorks = role.getCompleteWorks();
    }

    @Override
    public String toString() {
        return "UserRoleDto{" +
                "userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", userRole='" + userRole + '\'' +
                ", nickName='" + nickName + '\'' +
                ", phone='" + phone + '\'' +
                ", loginPwd='" + loginPwd + '\'' +
                ", email='" + email + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", registerDate=" + registerDate +
                ", userIconPath='" + userIconPath + '\'' +
                ", roleId=" + roleId +
                ", content='" + content + '\'' +
                ", showPhoto='" + showPhoto + '\'' +
                ", orderStatus=" + orderStatus +
                ", completeWorks=" + completeWorks +
                '}';
    }
}
